<template>
  <div class="exhibits-content" :style="{ width: props.info.width + 'rem', height: props.info.height + 'rem' }">
    <t-image-viewer v-model:visible="ImgVisible" :images="[getLinkUrl(ImgUrl)]"> </t-image-viewer>
    <div
      class="decorate"
      :style="{
        'background-image': `url(${publicUrls + 'free/style1/exhibitionStandStyle5zs.webp'})`,
      }"
    ></div>
    <div
      :style="{
        'background-image': `url(${publicUrls + 'free/style1/exhibitionStandStyle5Item.webp'})`,
      }"
      @contextmenu.stop="emit('onContextMenuChild', $event, index)"
      class="exhibits-item"
      v-for="(item, index) in props.info.showpieceList"
      :key="index"
    >
      <p class="title">{{ item.name }}</p>
      <div class="cover-box" @click="viewImg(item.moduleId, item.id)">
        <img class="cover" v-lazy="getLinkUrl(item.coverUrl, '?imageView2/3/w/600/format/webp')" alt="" />
        <img class="flower-btn" v-lazy="publicUrls + 'free/style1/flower.png?imageView2/format/webp'" />
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'style5',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import { DraggableContainer } from 'vue3-draggable-resizable';
// import FlotMenu from '@/components/flotMenu/OutlineMenu.vue';
import ContextMenu from '@imengyu/vue3-context-menu';
import { getDraggableNumber, getExhibitsHeightRest, getdisabledY } from '@/utils/getRemComputed';
import { ref, reactive, watch, nextTick, defineComponent } from 'vue';
import { exbitMenuShow, exbitListMenuShow } from '@/hooks/menuHooks';
import { useProjectStore } from '@/store';
import { getLinkUrl } from '@/utils/request/upload';

const emit = defineEmits([
  'emitChildItemDraggable',
  'emitChildItemDraggableStyle',
  'emitShowcaseDraggable',
  'emitShowcaseDraggableStyle',
  'onContextMenuChild',
]);
const store = useProjectStore();
const contextMenuTrigger = ref(); //列表盒子dom
const parentLock = ref(true);
const childShow = ref(true);
const draggableResizable = ref(); //父级拖拽盒子ref
const timer = ref();
const ImgVisible = ref(false);
const ImgUrl = ref('');

const props = defineProps({
  width: {
    type: Number || String,
  },
  height: {
    type: Number || String,
  },
  indexs: {
    type: Number,
  },
  info: {
    type: Object,
  },
  childId: {
    type: Number,
  },
  AuxiliaryId: {
    type: Number,
  },
});

const viewImg = (moduleId: number, e?: number) => {
  store.exhibitsModuleId = moduleId;
  store.exhibitsShowpieceid = e;
  store.exhibitsInfoShow = true;
};
const handleMouseDown = (event) => {
  event.stopPropagation();
};
const preventDefaultDrag = (event) => {
  event.stopPropagation();
};
</script>

<style lang="less" scoped>
.exhibits-content {
  position: relative;
  display: flex;
  z-index: 999;
  padding: 10px;
}
.exhibits-content::after {
  content: '';
  position: absolute;
  bottom: -15px; /* 根据需要调整倒影与盒子的距离 */
  left: 0;
  width: 100%;
  height: 100%; /* 根据需要调整倒影的高度 */
  -webkit-box-reflect: below 0% linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}
.active {
  :deep(.flot-menu) {
    display: flex;
  }
}
:deep(.active) {
  z-index: 999;
}
:deep(.vdr-handle) {
  z-index: 66;
}
.exhibits-item {
  width: 256px;
  height: 684px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-box-reflect: below -10px linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15));
  z-index: 1;
  margin: 0 40px;
  position: relative;
  &:nth-child(2n) {
    margin-top: 77px;
  }
  &::after {
    content: '';
    width: 120px;
    height: 242px;
    background: url(https://static.jiyi.show/free/style1/exhibitionStandStyle5Bottle.webp) no-repeat center/100% 100%;
    bottom: -15px;
    left: -60px;
    position: absolute;
  }
  .cover-box {
    width: 247px;
    height: 401px;
    position: relative;
    &:hover {
      .mask-layer {
        opacity: 1;
      }
      .flower-btn {
        display: none;
      }
    }
    .cover {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
    .flower-btn {
      width: 40px;
      height: 40px;
      object-fit: cover;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      animation: flower 2s linear infinite;
      @keyframes flower {
        0% {
          opacity: 0;
        }
        40% {
          opacity: 100%;
        }
        80% {
          opacity: 100%;
        }
        100% {
          opacity: 0;
        }
      }
    }
  }
}
.title {
  width: 100%;
  height: 32px;
  color: #fef3df;
  text-align: center;
  font-size: 16px;
  line-height: 32px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  margin-top: 20px;
  padding: 0 25px;
  margin-bottom: 13px;
}
.decorate {
  width: 500px;
  height: 393px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  margin-top: 60px;
  margin-right: 122px;
}
</style>
